<!-- 用户列表 -->
<template>
    <div class="page-box h100 display-flex czbj">
      <p class="title-label">消费记录</p>
      <div class="mt10">
        <dxtable
          czWidth="240"
          :dataJson="dataJson"
          :portUrl="portUrl"
          :isshowXz="false"
          :qx="qx"
          ref="databale"
        >
        </dxtable>
      </div>
    </div>
  </template>
  <script lang="ts" setup>
  import dxtable from "../../components/util/dxtable.vue";
  import { dxget, dxpost, qurl, hf, dialog } from "../../util/index";
  import { h, ref, reactive } from "vue";
  import { NButton } from "naive-ui";
  import expenseCalendar from "./list.vue";
  const showModal = ref(false);
  const openid = ref();
  const initeer = () => {
    databale.value.initDataExpose();
  };
  const databale = ref();
  // 弹窗公用该列表
  let dataJson = reactive([
    {
      title: "头像",
      key: "headimgurl",
      width:80,
      render(row) {
        return h("img", { class: "dsfsdtrtr", src: row.headPortrait });
      },
    },
    {
      title: "昵称",
      key: "wname",
      width:160,
    },
    {
      title: "电话号码",
      key: "phone",
      width:120,
    },
  
    {
      title: "消费名称",
      key: "name",
    },
    {
      title: "消费积分",
      key: "jiner",
      width:80,
    },
    {
      title: "消费时间",
      key: "addTime",
      width:140,
    },
  ]);
  const Userid = localStorage.id;
  let portUrl = "xinxi100/czjilu/czjilu?ispc=2";
  const qx = {
    DeletePermissionID: "xinxi100xiaofeijldel", //删除
    EditPermissionIdentifier: "xinxi100xiaofeijlbj", // 编辑
    NewPermissionIdentifier: "xinxi100xiaofeijlxz", // 新建
    ViewPermissionID: "xinxi100xiaofeijlck", // 查看
  };
  
  const czFun = {
    fun: (row) => {
      const userType = row.userType;
      return [
        h(
          NButton,
          {
            type: "info",
            quaternary: true,
            onClick: async (e) => {
              const jxcxdf = await dialog("确认拉黑此用户吗？");
              if (jxcxdf == 1) {
                await dxpost(
                  "dxgjAdmin/wxcharUser",
                  { id: row.id, islahei: row.islahei==1?2:1 },
                  "put"
                );
                window.$message.success("操作成功！")
                initeer()
              }
            },
          },
          row.islahei=='1'?"拉黑":'解除拉黑'
        ),h(
          NButton,
          {
            type: "info",
            quaternary: true,
            onClick: async (e) => {
              hf('xinxi100diezhigl?openid='+row.openid)
            },
          },
          '帖子'
        ),
      ];
    },
  };
  </script>
  